<%--
  Created by IntelliJ IDEA.
  User: focus
  Date: 2018/1/5
  Time: 10:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../base.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <base href="<%=basePath%>">
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/>
    <meta name="renderer" content="webkit"/>
    <title>注册 - WeCenter 社交化问答社区程序</title>
    <meta name="keywords" content="wecenter,知识社区,企业社区,社交问答,问答社区,企业社交,开源社区程序,社交社区程序,开源问答程序,问答网站,social question,微信,微信公众平台,微信开发,微信开发社区,微信应用"/>
    <meta name="description" content="WeCenter 是一款知识型的社交化问答社区程序，专注于社区内容的整理、归类和检索，并通过连接微信公众平台，移动APP进行内容分发。"/>
    <link href="css/default/img/favicon.ico?v=20160523" rel="shortcut icon" type="image/x-icon"/>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="css/icon.css"/>
    <link href="css/default/common.css?v=20160523" rel="stylesheet" type="text/css"/>
    <link href="css/default/link.css?v=20160523" rel="stylesheet" type="text/css"/>
    <link href="js/plug_module/style.css?v=20160523" rel="stylesheet" type="text/css"/>
    <link href="css/default/register.css?v=20160523" rel="stylesheet" type="text/css"/>

    <script type="text/javascript">
        var _615E2677FF0D63CFCC032EE86B89842C = "";
        var G_POST_HASH = _615E2677FF0D63CFCC032EE86B89842C;
        var G_INDEX_SCRIPT = "";
        var G_SITE_NAME = "WeCenter 社交化问答社区程序";
        var G_BASE_URL = "http://wenda.wecenter.com";
        var G_STATIC_URL = "http://wenda.wecenter.com/static";
        var G_UPLOAD_URL = "http://wenda.wecenter.com/uploads";
        var G_USER_ID = "";
        var G_USER_NAME = "";
        var G_UPLOAD_ENABLE = "N";
        var G_UNREAD_NOTIFICATION = 0;
        var G_NOTIFICATION_INTERVAL = 100000;
        var G_CAN_CREATE_TOPIC = "";
        var G_ADVANCED_EDITOR_ENABLE = "Y";
        var FILE_TYPES = "jpg,jpeg,png,zip,rar,7z";
    </script>

    <script src="js/jquery.2.js?v=20160523" type="text/javascript"></script>
    <script src="js/jquery.form.js?v=20160523" type="text/javascript"></script>
    <script src="js/plug_module/plug-in_module.js?v=20160523" type="text/javascript"></script>
    <script src="js/aws.js?v=20160523" type="text/javascript"></script>
    <script src="js/aw_template.js?v=20160523" type="text/javascript"></script>
    <script src="js/app.js?v=20160523" type="text/javascript"></script>
    <script type="text/javascript" src="js/compatibility.js"></script>
    <!--[if lte IE 8]>
    <script type="text/javascript" src="js/respond.js"></script>
    <![endif]-->
</head>
<noscript unselectable="on" id="noscript">
    <div class="aw-404 aw-404-wrap container">
        <img src="common/no-js.jpg">
        <p>你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!</p>
    </div>
</noscript>
<body>
<div class="aw-register-box">
    <div class="mod-head">
        <a href="index.html"><img src="css/default/img/login_logo.png" alt=""/></a>
        <h1>注册新用户</h1>
    </div>
    <div class="mod-body">
        <form class="aw-register-form" action="user/ajax/register" method="post"
              id="register_form">
            <ul>
                <li class="alert alert-danger collapse error_message text-left">
                    <i class="icon icon-delete"></i> <em></em>
                </li>
                <li>
                    <input class="aw-register-name form-control" type="text" name="user_name" placeholder="用户名"
                           tips="请输入一个 2-14 位的用户名" errortips="用户名长度不符合" value=""/>
                </li>
                <li>
                    <input class="aw-register-email form-control" type="text" placeholder="邮箱" name="email"
                           tips="请输入你常用的电子邮箱作为你的账号" value="" errortips="邮箱格式不正确"/>
                </li>
                <li>
                    <input class="aw-register-pwd form-control" type="password" name="password" placeholder="密码"
                           tips="请输入 6-16 个字符,区分大小写" errortips="密码不符合规则"/>
                </li>
                <li class="more-information collapse">
                    <ul>
                        <li>
                            性别:
                            <label>
                                <input name="sex" id="sex" value="1" type="radio"/> 男 </label>&nbsp;
                            <label>
                                <input name="sex" id="sex" value="2" type="radio"/> 女 </label>&nbsp;
                            <label>
                                <input name="sex" id="sex" value="3" type="radio" checked="checked"/> 保密 </label>
                        </li>
                        <li>
                            职业:
                            <select name="job">
                                <option value="">--</option>
                                <option value="站长">站长</option>
                                <option value="产品经理">产品经理</option>
                                <option value="视觉设计师">视觉设计师</option>
                                <option value="程序员">程序员</option>
                                <option value="前端工程师">前端工程师</option>
                                <option value="风险投资者">风险投资者</option>
                                <option value="职业经理人">职业经理人</option>
                                <option value="运营人员">运营人员</option>
                                <option value="人力资源">人力资源</option>
                                <option value="运维人员">运维人员</option>
                                <option value="创业者">创业者</option>
                                <option value="媒体">媒体</option>
                                <option value="天使">天使</option>
                                <option value="学生">学生</option>
                                <option value="其他">其他</option>
                            </select>
                        </li>
                        <li>
                            所在城市:
                            <select name="province" class="select_area" style="display:inline-block"></select>

                            <select name="city" class="select_area"></select>
                        </li>
                        <li>
                            <input type="text" class="form-control" placeholder="一句话介绍" id="welcome_signature" value=""
                                   name="signature"/>
                        </li>
                    </ul>
                </li>
                <li>
                    <hr/>
                    <a class="more-information-btn">更多资料</a>
                </li>
                <li class="aw-register-verify">
                    <img class="pull-right" id="captcha"
                         onclick="this.src =  'captcha/get?' + Math.floor(Math.random() * 10000);"
                         src="">

                    <input type="text" class="form-control" name="seccode_verify" placeholder="验证码"/>
                </li>
                <li class="last">
                    <label><input type="hidden" checked="checked" value="agree" name="agreement_chk"/> </label>
                    <a href="javascript:;" class="aw-agreement-btn"></a>
                    <a href="user/login" class="pull-right">已有账号?</a>
                    <div class="aw-register-agreement collapse">
                        <div class="aw-register-agreement-txt" id="register_agreement"></div>
                    </div>

                </li>
                <li class="clearfix">
                    <button class="btn btn-large btn-blue btn-block" onclick="AWS.ajax_post($('#register_form'), AWS.ajax_processer, 'error_message'); return false;">
                        注册
                    </button>
                </li>
            </ul>
        </form>
    </div>
    <div class="mod-footer"></div>
</div>

<script type="text/javascript">
    $(document).ready(function () {
        $('.aw-agreement-btn').click(function () {
            if ($('.aw-register-agreement').is(':visible')) {
                $('.aw-register-agreement').hide();
            }
            else {
                $('.aw-register-agreement').show();
            }
        });

        $('.more-information-btn').click(function () {
            $('.more-information').fadeIn();
            $(this).parent().hide();
        });

        verify_register_form('#register_form');

        /* 注册页面验证 */
        function verify_register_form(element) {
            $(element).find('[type=text], [type=password]').on({
                focus: function () {
                    if (typeof $(this).attr('tips') != 'undefined' && $(this).attr('tips') != '') {
                        $(this).parent().append('<span class="aw-reg-tips">' + $(this).attr('tips') + '</span>');
                    }
                },
                blur: function () {
                    if ($(this).attr('tips') != '') {
                        switch ($(this).attr('name')) {
                            case 'user_name' :
                                var _this = $(this);
                                $(this).parent().find('.aw-reg-tips').detach();
                                if ($(this).val().length >= 0 && $(this).val().length < 2) {
                                    $(this).parent().find('.aw-reg-tips').detach();
                                    $(this).parent().append('<span class="aw-reg-tips aw-reg-err"><i class="aw-icon i-err"></i>' + $(this).attr('errortips') + '</span>');
                                    return;
                                }
                                if ($(this).val().length > 17) {
                                    $(this).parent().find('.aw-reg-tips').detach();
                                    $(this).parent().append('<span class="aw-reg-tips aw-reg-err"><i class="aw-icon i-err"></i>' + $(this).attr('errortips') + '</span>');
                                    return;
                                }
                                else {
                                    $.post('user/ajax/check_username/',
                                        {
                                            username: $(this).val()
                                        }, function (result) {
                                            if (!result.success) {
                                                _this.parent().find('.aw-reg-tips').detach();
                                                _this.parent().append('<span class="aw-reg-tips aw-reg-err"><i class="aw-icon i-err"></i>' + result.data + '</span>');
                                            }
                                            else {
                                                _this.parent().find('.aw-reg-tips').detach();
                                                _this.parent().append('<span class="aw-reg-tips aw-reg-right"><i class="aw-icon i-followed"></i></span>');
                                            }
                                        }, 'json');
                                }
                                return;

                            case 'email' :
                                $(this).parent().find('.aw-reg-tips').detach();
                                var emailreg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
                                if (!emailreg.test($(this).val())) {
                                    $(this).parent().find('.aw-reg-tips').detach();
                                    $(this).parent().append('<span class="aw-reg-tips aw-reg-err"><i class="aw-icon i-err"></i>' + $(this).attr('errortips') + '</span>');
                                    return;
                                }
                                else {
                                    $(this).parent().find('.aw-reg-tips').detach();
                                    $(this).parent().append('<span class="aw-reg-tips aw-reg-right"><i class="aw-icon i-followed"></i></span>');
                                }
                                return;

                            case 'password' :
                                $(this).parent().find('.aw-reg-tips').detach();
                                if ($(this).val().length >= 0 && $(this).val().length < 6) {
                                    $(this).parent().find('.aw-reg-tips').detach();
                                    $(this).parent().append('<span class="aw-reg-tips aw-reg-err"><i class="aw-icon i-err"></i>' + $(this).attr('errortips') + '</span>');
                                    return;
                                }
                                if ($(this).val().length > 17) {
                                    $(this).parent().find('.aw-reg-tips').detach();
                                    $(this).parent().append('<span class="aw-reg-tips aw-reg-err"><i class="aw-icon i-err"></i>' + $(this).attr('errortips') + '</span>');
                                    return;
                                }
                                else {
                                    $(this).parent().find('.aw-reg-tips').detach();
                                    $(this).parent().append('<span class="aw-reg-tips aw-reg-right"><i class="aw-icon i-followed"></i></span>');
                                }
                                return;

                        }
                    }

                }
            });
        }

        $('.select_area').LocationSelect({
            labels: ["请选择省份或直辖市", "请选择城市"],
            elements: document.getElementsByTagName("select"),
            detector: function () {
                this.select(["", ""]);
            },
            dataUrl: 'js/areas.js'
        });
    });
</script>
<a class="aw-back-top hidden-xs" href="javascript:;" onclick="$.scrollTo(1, 600, {queue:true});"><i class="icon icon-up"></i></a>
<div id="aw-ajax-box" class="aw-ajax-box"></div>
</body>
</html>